home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple II Magazines (PO)
/
Nibble Volume 09, No. 07 (1988-07)(MicroSPARC)(Side A).zip
/
Nibble Volume 09, No. 07 (1988-07)(MicroSPARC)(Side A).po
/
NR.CONVERTER.S
< prev
next >
Wrap
Text File
|
1996-12-24
|
4KB
|
136 lines
;******************************
; * *
; * NR.POKE *
; * by Sherman Paddock *
; > CopyRight (c) 1987 <
; * by MicroSPARC, Inc *
; * Concord, MA 01742 *
; * *
;******************************
; * *
; >The MicroSPARC ASSEMBLER<
; * *
;******************************
;
;
; NOTE: This is already in the
; AppleSoft program and does
; not need to be keyed in
;
;
ARYTAB EQU $6B
ARYSAVE EQU $FC
NRADRS EQU $FE
COUNTER EQU $4000 ;#16384
*
ORG $0300 ;#768
*
LDA #$40
STA NRADRS+1 ;Initialize NewsRoom data
LDY #$00 ; address to $4000
STY NRADRS
STY COUNTER+1
*
INY
STY COUNTER ;Initialize byte counter to one
*
INY
LDX #0
ESTABHD LDA HEADER,X
STA (NRADRS),Y ;Establish NewsRoom header
INY
INX
CPX #5
BCC ESTABHD
*
STY NRADRS ;Now established as $4007
*
CLC
LDA ARYTAB
PHA ;Save original pointer
ADC #7 ; then add 7 to it
STA ARYTAB
STA ARYSAVE ; and save for later
LDA ARYTAB+1
PHA
ADC #0
STA ARYTAB+1
STA ARYSAVE+1
*
GETLEN LDY #0
LDA (ARYTAB),Y ;Get length of each record
BEQ LASTRECD ;if there are no more records
*
TAX ;Save length in 'X'
INC ARYTAB
BNE SAVEPTR
*
INC ARYTAB+1
SAVEPTR LDA ARYTAB+1
PHA ;Save record adrs pointer to Stack
LDA ARYTAB
PHA
*
LDA (ARYTAB),Y
PHA ;Temp save low-byte of record adrs
INY
LDA (ARYTAB),Y
STA ARYTAB+1
PLA ;Retreive low-byte
STA ARYTAB ;now points to record
DEY
*
INCRCNTR INC COUNTER ;Count each byte processed
BNE MVRECORD
INC COUNTER+1
*
MVRECORD LDA (ARYTAB),Y ;Move record
STA (NRADRS),Y ; to new area
INY
DEX
BNE INCRCNTR ; until 'X' equals zero
*
TYA
CLC
ADC NRADRS
STA NRADRS ;Update address
LDA #0
ADC NRADRS+1
STA NRADRS+1
*
CLC
PLA ;Retreive record adrs pointer
ADC #2 ; from Stack, then add two to
STA ARYTAB ; point to next record's length
PLA
ADC #0
STA ARYTAB+1
BNE GETLEN ;(always branches)
*
LASTRECD LDA #127
STA (NRADRS),Y ;Insert NewsRoom ending flag
*
LDA #69
ADC ARYSAVE ;Find 24th record
STA NRADRS
LDA #0
ADC ARYSAVE+1
STA NRADRS+1
*
MVARRAY LDA (NRADRS),Y ;Move all records
STA (ARYSAVE),Y; up 24
INY
CPY #234
BCC MVARRAY
*
PLA ;Return original pointer
STA ARYTAB+1
PLA
STA ARYTAB
*
RTS
*
*****
*
HEADER DFC $00,$01,$54,$73,$00